/**
 * this page is an ajax page for login.html
 */

$(document).ready(function () {
	$('#login').click(function () {
		$.ajax({
			url: '../login.action',    
    		type: 'post',    
    		cache: false,    
    		dataType: 'json',   
    		data: {adminInfo:$.toJSON({adminId:$('#inputEmail').val(),adminPsd:$('#inputPassword').val()})}, 
    		success: function (resp) {
    			var result = eval("("+resp+")");
        		if( result.flag == "true" ){  
        			alert("登录成功");
         	    	window.location.href = "index.html";
                }else{  
                 	alert(result.reason);    
                }    
    		},    
    		error : function () {   
         	 	alert("通信失败");    
    		}    
		})

	});
})